Skip to content

chore(deps): bump rand from 0.9.3 to 0.10.1 - #49

Merged
hyperpolymath merged 2 commits into
mainfrom
dependabot/cargo/rand-0.10.1
May 15, 2026
Merged

chore(deps): bump rand from 0.9.3 to 0.10.1#49
hyperpolymath merged 2 commits into
mainfrom
dependabot/cargo/rand-0.10.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 13, 2026

Copy link
Copy Markdown
Contributor

Bumps rand from 0.9.3 to 0.10.1.

Changelog

Sourced from rand's changelog.

[0.10.1] — 2026-02-11

This release includes a fix for a soundness bug; see #1763.

Changes

  • Document panic behavior of make_rng and add #[track_caller] (#1761)
  • Deprecate feature log (#1763)

#1761: rust-random/rand#1761 #1763: rust-random/rand#1763

[0.10.0] - 2026-02-08

Changes

  • The dependency on rand_chacha has been replaced with a dependency on chacha20. This changes the implementation behind StdRng, but the output remains the same. There may be some API breakage when using the ChaCha-types directly as these are now the ones in chacha20 instead of rand_chacha (#1642).
  • Rename fns IndexedRandom::choose_multiple -> sample, choose_multiple_array -> sample_array, choose_multiple_weighted -> sample_weighted, struct SliceChooseIter -> IndexedSamples and fns IteratorRandom::choose_multiple -> sample, choose_multiple_fill -> sample_fill (#1632)
  • Use Edition 2024 and MSRV 1.85 (#1653)
  • Let Fill be implemented for element types, not sliceable types (#1652)
  • Fix OsError::raw_os_error on UEFI targets by returning Option<usize> (#1665)
  • Replace fn TryRngCore::read_adapter(..) -> RngReadAdapter with simpler struct RngReader (#1669)
  • Remove fns SeedableRng::from_os_rng, try_from_os_rng (#1674)
  • Remove Clone support for StdRng, ReseedingRng (#1677)
  • Use postcard instead of bincode to test the serde feature (#1693)
  • Avoid excessive allocation in IteratorRandom::sample when amount is much larger than iterator size (#1695)
  • Rename os_rng -> sys_rng, OsRng -> SysRng, OsError -> SysError (#1697)
  • Rename Rng -> RngExt as upstream rand_core has renamed RngCore -> Rng (#1717)

Additions

  • Add fns IndexedRandom::choose_iter, choose_weighted_iter (#1632)
  • Pub export Xoshiro128PlusPlus, Xoshiro256PlusPlus prngs (#1649)
  • Pub export ChaCha8Rng, ChaCha12Rng, ChaCha20Rng behind chacha feature (#1659)
  • Fn rand::make_rng() -> R where R: SeedableRng (#1734)

Removals

  • Removed ReseedingRng (#1722)
  • Removed unused feature "nightly" (#1732)
  • Removed feature small_rng (#1732)

#1632: rust-random/rand#1632 #1642: rust-random/rand#1642 #1649: rust-random/rand#1649 #1652: rust-random/rand#1652 #1653: rust-random/rand#1653 #1659: rust-random/rand#1659 #1665: rust-random/rand#1665 #1669: rust-random/rand#1669 #1674: rust-random/rand#1674 #1677: rust-random/rand#1677 #1693: rust-random/rand#1693 #1695: rust-random/rand#1695 #1697: rust-random/rand#1697

... (truncated)

Commits

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels May 13, 2026
@hyperpolymath

Copy link
Copy Markdown
Owner

@dependabot rebase

Bumps [rand](https://github.com/rust-random/rand) from 0.9.3 to 0.10.1.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](rust-random/rand@0.9.3...0.10.1)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.10.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/cargo/rand-0.10.1 branch from a019fe7 to 9058239 Compare May 14, 2026 19:03
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit baa60db into main May 15, 2026
26 of 33 checks passed
@hyperpolymath
hyperpolymath deleted the dependabot/cargo/rand-0.10.1 branch May 15, 2026 02:02
hyperpolymath added a commit that referenced this pull request Jun 6, 2026
## Summary

Sub-PR #4 of the Android Kotlin→Rust/Gossamer migration (epic #83, RFC
#97, sub-issue #110). Implements the native (`neurophone_android`) JNI
surface, replacing the `pub fn hello()` stub with the full 11-method
`ai.neurophone.NativeLib` contract. The most independent step of the
migration — no Service/widget/UI code is touched.

Each `Java_ai_neurophone_NativeLib_*` export decodes its JVM arguments
and delegates to the existing pure-Rust workspace crates:
- `neurophone-core` (`NeuroSymbolicSystem`) — lifecycle, sensor
processing, neural context, state, hybrid query router.
- `llm` (`MockBackend`) — on-device LLM stand-in (`llama.cpp` swaps in
later).
- `claude-client` (`HybridInference` / `ClaudeClient`) — cloud path,
with a graceful "no API key" branch.
- `sensors` (`SensorKind`) — Android sensor-type id mapping.

### JNI contract implemented (class `ai.neurophone.NativeLib`, lib
`neurophone_android`)
`init(String?)->bool`, `start()->bool`, `stop()->void`,
`processSensor(int, float[], long, int)->bool`,
`queryLocal(String)->String`, `queryClaude(String)->String`,
`query(String, bool)->String`, `getNeuralContext()->String`,
`getState()->String(JSON)`, `reset()->void`, `isRunning()->bool`.

Sensor-type id map per spec: accelerometer=1, magnetometer=2,
gyroscope=4, light=5, proximity=8, else unknown (rejected).

## Files changed
- **`crates/neurophone-android/src/lib.rs`** — full JNI implementation
(was a stub). A `Mutex`-guarded process-global `NativeRuntime`
singleton; safe `core_*` functions hold all logic; thin `unsafe extern
"C"` exports decode args and delegate. 7 unit tests.
- **`crates/neurophone-android/Cargo.toml`** — add `claude-client` and
`llm` path deps.
- **`Cargo.toml`** (workspace) — pin `jni = "0.21"`; revert
`rand`/`rand_distr` to `0.9`/`0.5` (see Risks).
- **`Cargo.lock`** — refreshed (`jni 0.21.1`, `rand 0.9.4`).

The Kotlin/Java bindings (`NativeLib.kt`, `MainActivity.kt`) are
intentionally **left untouched** — reconciled in the shim PRs /
legacy-delete step. Marked `TODO(#83)` in code.

## Unsafe-on-JNI-boundary justification
The crate is `#[deny(unsafe_code)]`. The JVM resolves native methods by
C symbol name (`Java_<class>_<method>`), which requires
`#[unsafe(no_mangle)]` + `unsafe extern "C"` — there is no safe-Rust
spelling of an exported C-ABI symbol, and the `jni` handles are raw
JVM-provided values. So:
- The crate-level lint was relaxed from `forbid` to
`#[deny(unsafe_code)]`.
- Each JNI export carries a **local, documented** `#[allow(unsafe_code)]
// JNI ABI: see module-level justification.`
- Every export body immediately hands off to a safe `core_*` function
and performs **no** `unsafe` operations beyond the ABI declaration. The
`unsafe` surface is purely the entry-point signatures, confined to the
`jni_boundary` module.

## What I verified
- `cargo build --workspace` — green.
- `cargo test --workspace` — green: **32 test binaries, all pass**,
incl. 7 new tests here (sensor id map, config fallback,
init/start/stop/reset lifecycle, sensor arity/type validation,
local/cloud/hybrid query paths, JSON state shape, and pre-init safety).
- `cargo clippy -p neurophone-android --all-targets` — no warnings.
- `nm -D libneurophone_android.so` — all **11**
`Java_ai_neurophone_NativeLib_*` symbols exported.

## TODOs / risks
- **`rand`/`rand_distr` revert (pre-existing breakage).** Dependabot PRs
#49/#67 bumped `rand 0.9→0.10` and `rand_distr 0.5→0.6`, but
`ndarray-rand 0.16` still requires `rand 0.9`. This breaks `esn`/`lsm`
the moment the lockfile is refreshed; the committed `Cargo.lock` pinned
`rand 0.9.4`, which masked the regression. I reverted to `0.9`/`0.5`
(with an explanatory `NOTE(#83)` in `Cargo.toml`) so the workspace
builds. Re-bump only alongside an `ndarray-rand` upgrade that supports
`rand 0.10`. Happy to split this into its own commit/PR if preferred.
- **`jni` pinned to 0.21.** The workspace previously declared `0.22`,
whose native-method API was reworked around `EnvUnowned::with_env` and
is still settling. 0.21's `JNIEnv`-first-arg surface keeps the FFI
boundary small and auditable. Only `neurophone-android` consumes `jni`,
so the blast radius is nil. Revisit when 0.22's API stabilises.
- **`MockBackend` for local LLM** is a deterministic stand-in; real
`llama.cpp` wiring is out of scope (tracked separately).
- **`queryClaude`** builds a short-lived current-thread tokio runtime
per call and requires an API key from the environment; without one it
returns a clear `[claude-unavailable]` string rather than failing the
FFI call. Per-call runtime is fine for the current call pattern; revisit
if it becomes hot.
- **Kotlin still references these symbols** — binding declarations
deliberately left as-is for the shim/legacy-delete PRs (`TODO(#83)`).

https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Gu1JFCZHuBtBhAWPr4sMQw)_

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant